<%@page import="com.sun.xml.internal.bind.CycleRecoverable.Context"%>
<%@ page language="java" import="java.net.*" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用户登录</title>
<style type="text/css">
 body{    
      background-image: url(img/7.jpg);    
      background-repeat: repeat;    
 }    

</style>
</head>




<body>
	<%
	request.setCharacterEncoding("utf-8");
	String username = "" ;
	String password = "" ;
	
	Cookie[] cookies = request.getCookies();
	if(cookies != null && cookies.length > 0)
	{
		for (Cookie c:cookies)
		{
			if (c.getName().equals("username") )
			{
				username = URLDecoder.decode(c.getValue(),"utf-8");
			}
			if(c.getName().equals("password"))
			{
				password = URLDecoder.decode(c.getValue(),"utf-8"); 
			}
		}
	}
	
	
	%>
	<h1>用户登录</h1>
	<SUB>你好</SUB>
	<hr>
	<br>
	
	<div style="background-color:#618a56;">
	<form name="loginform" action ="Dologin.jsp" method="post">
		<table>
			<tr style="background-color:#ECF6EE;">
				<td>用户名：</td>
				<td><input type="text" name="username" value="<%=username %>" /></td>
			</tr>
			
			<tr style="background-color:#ECF6EE;">
				<td>密码：</td>
				<td><input type="password" name="password" value="<%=password %>" /></td>
			</tr>
			
			<tr>
				<td colspan="2" ><input type="checkbox" name="isUseCookie" checked="checked">十天内记住我的登录状态</td>
			</tr>
			<tr>
			<td colspan="2" align="center"><input type="submit" value="登录"><input type="reset" value="取消"></td>
			
			</tr>
		</table>
	</form>
	</div>
	<h2>当前在线人数：<%=session.getServletContext().getAttribute("userNumber") %>  </h2>
</body>
</html>